<template>
  <div>
  <el-row style="margin-top: 10px;">
    <el-col :span="6" :offset="6">
     <el-input v-model="warehouse.whName" placeholder="请输入仓库名称"></el-input>
    </el-col>
  </el-row>
  <el-row style="margin-top: 10px;">
    <el-col :span="6" :offset="6">
    <el-input v-model="warehouse.contact" placeholder="请输入仓库联系人姓名"></el-input>
    </el-col>
  </el-row>
  <el-row style="margin-top: 10px;">
    <el-col :span="6" :offset="6">
    <el-input v-model="warehouse.whPhone" placeholder="请输入仓库联系电话"></el-input>
    </el-col>
  </el-row>
  <el-row style="margin-top: 10px;">
    <el-col :span="6" :offset="6">
    <el-input v-model="warehouse.address" placeholder="请输入仓库地址"></el-input>
    </el-col>
  </el-row>
  <el-row style="margin-top: 50px;">
    <el-col :span="2" :offset="6">
      <el-button type="warning" @click="canel">重置</el-button>
    </el-col>
    <el-col :span="2" :offset="1">
      <el-button type="success" @click="addWharehouse">新增仓库</el-button>
    </el-col>
  </el-row>
  </div>
</template>

<script>
  export default{
    name:"AddWh",
    data(){
      return{
      warehouse:{}
      }
    },
    methods:{
      //重置
       canel(){
         this.warehouse={}
       },
       //新增仓库
       addWharehouse(){
         this.$http.post("/admin/pawnWarehouse/insertPawnWarehouse",this.warehouse).then(resp=>{
           if(resp.data.code==200){
             this.$message({
                       message: '添加门店成功',
                       type: 'success'
                     });
           }else{
              this.$message.error(resp.data.message);
           }
           this.warehouse={}
         })
       }
    }
  }
</script>

<style>
</style>
